package com.yanchangapp.adapter.fragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.yanchangapp.model.bean.TabBean;
import com.yanchangapp.ui.fragment.purchase.ContractListFragment;
import com.yanchangapp.ui.fragment.purchase.PListFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by apple on 2019-08-05.
 * description: 采购列表的
 */
public class ContractListFgAdapter extends FragmentPagerAdapter {
    private List<ContractListFragment> fragmentList = new ArrayList<>();
    private List<TabBean> mTitles = new ArrayList<>();

    public ContractListFgAdapter(FragmentManager fm, List<ContractListFragment> fragments, List<TabBean> title) {
        super(fm);
        this.fragmentList = fragments;
        this.mTitles = title;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles.get(position).getTitle();
    }
}
